<template>
  <div>
    <div class="title">
      <h1>精制工艺</h1>
    </div>
    <div class="content">
      <div style="display:none">{{ exitsValGL }}</div>
      <div style="display:none">{{ exitsValZL }}</div>
      <el-form>
        <h3>步骤选择：</h3>
        <br>
        <el-popover
          v-model="visible"
          placement="top"
          width="250"
        >
          <h3>添加步骤</h3>
          <p style="font-weight: bold ">药物活性成分提取率:</p>
          <el-input v-model="GL.extract" size="medium" placeholder="输入(0~1),默认值为0.80" />
          <p style="font-weight: bold ">排放因子:</p>
          <el-form ref="form" :model="GL" label-width="100px">
            <el-form-item
              label="水相："
              style="width: 250px;height:70px;font-size: 8ex;margin-left: -36px;margin-top:-9px"
              prop="water"
              :rules="[
                {required: false, message: '水相损失值不能为空',trigger: 'blur' }
              ]"
            >
              <br>
              <el-input
                v-model="GL.water"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.10"
                :disabled="false"
              />
            </el-form-item>
            <el-form-item
              label="固废："
              style="width: 250px;height:70px;font-size: 8ex;margin-left: -36px;margin-top:-10px"
              prop="solid"
              :rules="[
                {required: false, message: '固废损失值不能为空',trigger: 'blur' }
              ]"
            >
              <br>
              <el-input
                v-model="GL.solid"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.10"
                :disabled="false"
              />
            </el-form-item>
            <el-form-item
              label="气相："
              style="width: 250px;font-size: 8ex;margin-left: -36px;margin-top:-10px"
              prop="air"
              :rules="[
                {required: false, message: '气相损失值不能为空',trigger: 'blur',width:'max-content' }
              ]"
            >
              <br>
              <el-input
                v-model="GL.air"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0"
              />
            </el-form-item>
          </el-form>

          <div style="text-align: right; margin: 0">
            <el-button size="medium" type="text" @click="visible = false">取消</el-button>
            <el-tooltip placement="bottom" :disabled="!isDisabled" content="请检查输入之和是否等于1">
              <div style="display: inline-block">
                <el-button
                  type="primary"
                  size="medium"
                  :disabled="isDisabled"
                  @click="visible = false;addtag('过滤法');savepross('GL')"
                >确定
                </el-button>
              </div>
            </el-tooltip>
          </div>
          <el-button slot="reference" type="success" round>过滤法</el-button>
        </el-popover>

        <el-popover
          v-model="visible2"
          placement="top"
          width="250"
        >
          <h3>添加步骤</h3>
          <p style="font-weight: bold ">药物活性成分提取率:</p>
          <el-input v-model="CQ.extract" size="medium" placeholder="输入(0~1),默认值为0.90" />
          <p style="font-weight: bold ">排放因子:</p>
          <el-form ref="form" :model="CQ" label-width="100px">
            <el-form-item
              label="水相："
              style="width: 250px;height:70px;font-size: 8ex;margin-left: -36px;margin-top:-9px"
              prop="water"
              :rules="[
                {required: false, message: '水相损失值不能为空',trigger: 'blur' }
              ]"
            >
              <br>
              <el-input
                v-model="CQ.water"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.04"
                :disabled="false"
              />
            </el-form-item>
            <el-form-item
              label="固废："
              style="width: 250px;height:70px;font-size: 8ex;margin-left: -36px;margin-top:-10px"
              prop="solid"
              :rules="[
                {required: false, message: '固废损失值不能为空',trigger: 'blur' }
              ]"
            >
              <br>
              <el-input
                v-model="CQ.solid"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.05"
                :disabled="false"
              />
            </el-form-item>
            <el-form-item
              label="气相："
              style="width: 250px;font-size: 8ex;margin-left: -36px;margin-top:-10px"
              prop="air"
              :rules="[
                {required: false, message: '气相损失值不能为空',trigger: 'blur',width:'max-content' }
              ]"
            >
              <br>
              <el-input
                v-model="CQ.air"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.01"
                :disabled="false"
              />
            </el-form-item>
          </el-form>
          <div style="text-align: right; margin: 0">
            <el-button size="medium" type="text" @click="visible2 = false">取消</el-button>
            <el-tooltip placement="bottom" :disabled="!isDisabled" content="请检查输入之和是否等于1">
              <div style="display: inline-block">
                <el-button
                  type="primary"
                  size="medium"
                  :disabled="isDisabled"
                  @click="visible2 = false;addtag('萃取法');savepross('CQ')"
                >确定
                </el-button>
              </div>
            </el-tooltip>
          </div>
          <el-button slot="reference" type="success" round>萃取法</el-button>
        </el-popover>
        <el-popover
          v-model="visible3"
          placement="top"
          width="250"
        >
          <h3>添加步骤</h3>
          <p style="font-weight: bold ">药物活性成分提取率:</p>
          <el-input v-model="MFL.extract" size="medium" placeholder="输入(0~1),默认值为0.95" />
          <p style="font-weight: bold ">排放因子:</p>
          <el-form ref="form" :model="MFL" label-width="100px">
            <el-form-item
              label="水相："
              style="width: 250px;height:70px;font-size: 8ex;margin-left: -36px;margin-top:-9px"
              prop="water"
              :rules="[
                {required: false, message: '水相损失值不能为空',trigger: 'blur' }
              ]"
            >
              <br>
              <el-input
                v-model="MFL.water"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.01"
                :disabled="false"
              />
            </el-form-item>
            <el-form-item
              label="固废："
              style="width: 250px;height:70px;font-size: 8ex;margin-left: -36px;margin-top:-10px"
              prop="solid"
              :rules="[
                {required: false, message: '固废损失值不能为空',trigger: 'blur' }
              ]"
            >
              <br>
              <el-input
                v-model="MFL.solid"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.04"
                :disabled="false"
              />
            </el-form-item>
            <el-form-item
              label="气相："
              style="width: 250px;font-size: 8ex;margin-left: -36px;margin-top:-10px"
              prop="air"
              :rules="[
                {required: false, message: '气相损失值不能为空',trigger: 'blur',width:'max-content' }
              ]"
            >
              <br>
              <el-input
                v-model="MFL.air"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0"
                :disabled="false"
              />
            </el-form-item>
          </el-form>
          <div style="text-align: right; margin: 0">
            <el-button size="medium" type="text" @click="visible3 = false">取消</el-button>
            <el-tooltip placement="bottom" :disabled="!isDisabled" content="请检查输入之和是否等于1">
              <div style="display: inline-block">
                <el-button
                  type="primary"
                  size="medium"
                  :disabled="isDisabled"
                  @click="visible3 = false;addtag('膜分离法');savepross('MFL')"
                >确定
                </el-button>
              </div>
            </el-tooltip>
          </div>
          <el-button slot="reference" type="success" round>膜分离法</el-button>
        </el-popover>
        <el-popover
          v-model="visible4"
          placement="top"
          width="250"
        >
          <h3>添加步骤</h3>
          <p style="font-weight: bold ">药物活性成分提取率:</p>
          <el-input v-model="JJ.extract" size="medium" placeholder="输入(0~1),默认值为0.90" />
          <p style="font-weight: bold ">排放因子:</p>
          <el-form ref="form" :model="JJ" label-width="100px">
            <el-form-item
              label="水相："
              style="width: 250px;height:70px;font-size: 8ex;margin-left: -36px;margin-top:-9px"
              prop="water"
              :rules="[
                {required: false, message: '水相损失值不能为空',trigger: 'blur' }
              ]"
            >
              <br>
              <el-input
                v-model="JJ.water"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.04"
                :disabled="false"
              />
            </el-form-item>
            <el-form-item
              label="固废："
              style="width: 250px;height:70px;font-size: 8ex;margin-left: -36px;margin-top:-10px"
              prop="solid"
              :rules="[
                {required: false, message: '固废损失值不能为空',trigger: 'blur' }
              ]"
            >
              <br>
              <el-input
                v-model="JJ.solid"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.05"
                :disabled="false"
              />
            </el-form-item>
            <el-form-item
              label="气相："
              style="width: 250px;font-size: 8ex;margin-left: -36px;margin-top:-10px"
              prop="air"
              :rules="[
                {required: false, message: '气相损失值不能为空',trigger: 'blur',width:'max-content' }
              ]"
            >
              <br>
              <el-input
                v-model="JJ.air"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.01"
                :disabled="false"
              />
            </el-form-item>
          </el-form>
          <div style="text-align: right; margin: 0">
            <el-button size="medium" type="text" @click="visible4 = false">取消</el-button>
            <el-tooltip placement="bottom" :disabled="!isDisabled" content="请检查输入之和是否等于1">
              <div style="display: inline-block">
                <el-button
                  type="primary"
                  size="medium"
                  :disabled="isDisabled"
                  @click="visible4 = false;addtag('结晶法');savepross('JJ')"
                >确定
                </el-button>
              </div>
            </el-tooltip>
          </div>
          <el-button slot="reference" type="success" round>结晶法</el-button>
        </el-popover>

        <br>
        <br>
        <br>
        <br>
        <!--        &ensp;&ensp;&ensp;&ensp;&ensp;&ensp-->
        <el-popover
          v-model="visible5"
          placement="top"
          width="250"
        >
          <h3>添加步骤</h3>
          <p style="font-weight: bold ">药物活性成分提取率:</p>
          <el-input v-model="XF.extract" size="medium" placeholder="输入(0~1),默认值为0.85" />
          <p style="font-weight: bold ">排放因子:</p>
          <el-form ref="form" :model="XF" label-width="100px">
            <el-form-item
              label="水相："
              style="width: 250px;height:70px;font-size: 8ex;margin-left: -36px;margin-top:-9px"
              prop="water"
              :rules="[
                {required: false, message: '水相损失值不能为空',trigger: 'blur' }
              ]"
            >
              <br>
              <el-input
                v-model="XF.water"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.07"
                :disabled="false"
              />
            </el-form-item>
            <el-form-item
              label="固废："
              style="width: 250px;height:70px;font-size: 8ex;margin-left: -36px;margin-top:-10px"
              prop="solid"
              :rules="[
                {required: false, message: '固废损失值不能为空',trigger: 'blur' }
              ]"
            >
              <br>
              <el-input
                v-model="XF.solid"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.08"
                :disabled="false"
              />
            </el-form-item>
            <el-form-item
              label="气相："
              style="width: 250px;font-size: 8ex;margin-left: -36px;margin-top:-10px"
              prop="air"
              :rules="[
                {required: false, message: '气相损失值不能为空',trigger: 'blur',width:'max-content' }
              ]"
            >
              <br>
              <el-input
                v-model="XF.air"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0"
                :disabled="false"
              />
            </el-form-item>
          </el-form>
          <div style="text-align: right; margin: 0">
            <el-button size="medium" type="text" @click="visible5 = false">取消</el-button>
            <el-tooltip placement="bottom" :disabled="!isDisabled" content="请检查输入之和是否等于1">
              <div style="display: inline-block">
                <el-button
                  type="primary"
                  size="medium"
                  :disabled="isDisabled"
                  @click="visible5 = false;addtag('吸附法');savepross('XF')"
                >确定
                </el-button>
              </div>
            </el-tooltip>
          </div>
          <el-button slot="reference" type="success" round>吸附法</el-button>
        </el-popover>
        <el-popover
          v-model="visible6"
          placement="top"
          width="250"
        >
          <h3>添加步骤</h3>
          <p style="font-weight: bold ">药物活性成分提取率:</p>
          <el-input v-model="SP.extract" size="medium" placeholder="输入(0~1),默认值为0.90" />
          <p style="font-weight: bold ">排放因子:</p>
          <el-form ref="form" :model="SP" label-width="100px">
            <el-form-item
              label="水相："
              style="width: 250px;height:70px;font-size: 8ex;margin-left: -36px;margin-top:-9px"
              prop="water"
              :rules="[
                {required: false, message: '水相损失值不能为空',trigger: 'blur' }
              ]"
            >
              <br>
              <el-input
                v-model="SP.water"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.05"
                :disabled="false"
              />
            </el-form-item>
            <el-form-item
              label="固废："
              style="width: 250px;height:70px;font-size: 8ex;margin-left: -36px;margin-top:-10px"
              prop="solid"
              :rules="[
                {required: false, message: '固废损失值不能为空',trigger: 'blur' }
              ]"
            >
              <br>
              <el-input
                v-model="SP.solid"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.05"
                :disabled="false"
              />
            </el-form-item>
            <el-form-item
              label="气相："
              style="width: 250px;font-size: 8ex;margin-left: -36px;margin-top:-10px"
              prop="air"
              :rules="[
                {required: false, message: '气相损失值不能为空',trigger: 'blur',width:'max-content' }
              ]"
            >
              <br>
              <el-input
                v-model="SP.air"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0"
                :disabled="false"
              />
            </el-form-item>
          </el-form>
          <div style="text-align: right; margin: 0">
            <el-button size="medium" type="text" @click="visible6 = false">取消</el-button>
            <el-tooltip placement="bottom" :disabled="!isDisabled" content="请检查输入之和是否等于1">
              <div style="display: inline-block">
                <el-button
                  type="primary"
                  size="medium"
                  :disabled="isDisabled"
                  @click="visible6 = false;addtag('色谱法');savepross('SP')"
                >确定
                </el-button>
              </div>
            </el-tooltip>
          </div>
          <el-button slot="reference" type="success" round>色谱法</el-button>
        </el-popover>
        <el-popover
          v-model="visible7"
          placement="top"
          width="250"
        >
          <h3>添加步骤</h3>
          <p style="font-weight: bold ">药物活性成分提取率:</p>
          <el-input v-model="LX.extract" size="medium" placeholder="输入(0~1),默认值为0.85" />
          <p style="font-weight: bold ">排放因子:</p>
          <el-form ref="form" :model="LX" label-width="100px">
            <el-form-item
              label="水相："
              style="width: 250px;height:70px;font-size: 8ex;margin-left: -36px;margin-top:-9px"
              prop="water"
              :rules="[
                {required: false, message: '水相损失值不能为空',trigger: 'blur' }
              ]"
            >
              <br>
              <el-input
                v-model="LX.water"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.07"
                :disabled="false"
              />
            </el-form-item>
            <el-form-item
              label="固废："
              style="width: 250px;height:70px;font-size: 8ex;margin-left: -36px;margin-top:-10px"
              prop="solid"
              :rules="[
                {required: false, message: '固废损失值不能为空',trigger: 'blur' }
              ]"
            >
              <br>
              <el-input
                v-model="LX.solid"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.08"
                :disabled="false"
              />
            </el-form-item>
            <el-form-item
              label="气相："
              style="width: 250px;font-size: 8ex;margin-left: -36px;margin-top:-10px"
              prop="air"
              :rules="[
                {required: false, message: '气相损失值不能为空',trigger: 'blur',width:'max-content' }
              ]"
            >
              <br>
              <el-input
                v-model="LX.air"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0"
                :disabled="false"
              />
            </el-form-item>
          </el-form>
          <div style="text-align: right; margin: 0">
            <el-button size="medium" type="text" @click="visible7 = false">取消</el-button>
            <el-tooltip placement="bottom" :disabled="!isDisabled" content="请检查输入之和是否等于1">
              <div style="display: inline-block">
                <el-button
                  type="primary"
                  size="medium"
                  :disabled="isDisabled"
                  @click="visible7 = false;addtag('离心法');savepross('LX') "
                >确定
                </el-button>
              </div>
            </el-tooltip>
          </div>
          <el-button slot="reference" type="success" round>离心法</el-button>
        </el-popover>
        <el-popover
          v-model="visible8"
          placement="top"
          width="250"
        >
          <h3>添加步骤</h3>
          <p style="font-weight: bold ">药物活性成分提取率:</p>
          <el-input v-model="ZL.extract" size="medium" placeholder="输入(0~1),默认值为0.80" />
          <p style="font-weight: bold ">排放因子:</p>
          <el-form ref="form" :model="ZL" label-width="100px">
            <el-form-item
              label="水相："
              style="width: 250px;height:70px;font-size: 8ex;margin-left: -36px;margin-top:-9px"
              prop="water"
              :rules="[
                {required: false, message: '水相损失值不能为空',trigger: 'blur' }
              ]"
            >
              <br>
              <el-input
                v-model="ZL.water"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.09"
                :disabled="false"
              />
            </el-form-item>
            <el-form-item
              label="固废："
              style="width: 250px;height:70px;font-size: 8ex;margin-left: -36px;margin-top:-10px"
              prop="solid"
              :rules="[
                {required: false, message: '固废损失值不能为空',trigger: 'blur' }
              ]"
            >
              <br>
              <el-input
                v-model="ZL.solid"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.09"
                :disabled="false"
              />
            </el-form-item>
            <el-form-item
              label="气相："
              style="width: 250px;font-size: 8ex;margin-left: -36px;margin-top:-10px"
              prop="air"
              :rules="[
                {required: false, message: '气相损失值不能为空',trigger: 'blur',width:'max-content' }
              ]"
            >
              <br>
              <el-input
                v-model="ZL.air"
                size="medium"
                style="width: 250px;margin-left: -70px;margin-top:-10px"
                placeholder="输入(0~1),默认值为0.02"
                :disabled="false"
              />
            </el-form-item>
          </el-form>
          <div style="text-align: right; margin: 0">
            <el-button size="medium" type="text" @click="visible8 = false">取消</el-button>
            <el-tooltip placement="bottom" :disabled="!isDisabled" content="请检查输入之和是否等于1">
              <div style="display: inline-block">
                <el-button
                  type="primary"
                  size="medium"
                  :disabled="isDisabled"
                  @click="visible8 = false;addtag('蒸馏法');savepross('ZL') "
                >确定
                </el-button>
              </div>
            </el-tooltip>
          </div>
          <el-button slot="reference" type="success" round>蒸馏法</el-button>
        </el-popover>

      </el-form>
      <br>
      <br>
      <br>
      <br>
      <el-button style="margin-top: 12px;" @click="goBack">上一步</el-button>
      <el-button style="margin-top: 12px;" @click="sendEmissionFactor">下一步</el-button>
      <el-tooltip placement="bottom" :disabled="!iscancel" content="没有可撤销的步骤">
        <div style="display: inline-block">
          <el-button style="margin-top: 12px;margin-left: 10px" :disabled="iscancel" @click="deleteone">撤销</el-button>
        </div>
      </el-tooltip>
    </div>
    <!--    <component class="right" is="Addcard"></component>-->

    <div class="right">
      <h3>精致工艺步骤：</h3>
      <el-timeline>
        <el-timeline-item
          v-for="(activity, index) in activities"
          :key="index"
          :icon="activity.icon"
          :type="activity.type"
          :color="activity.color"
          :size="activity.size"
          :timestamp="activity.timestamp"
          :hide-timestamp="activity.hide"
        >
          {{ activity.content }}
        </el-timeline-item>

      </el-timeline>
    </div>

  </div>

</template>

<script>
import DirectUsage from './UsageParameters/DirectUsage'
import IndirectUsage from './UsageParameters/IndirectUsage'
import BaseInformation from './BaseInformation'
import evaluate from '../../../store/modules/evaluate'
import axios from 'axios'

export default {
  name: 'EmissionFactor',
  components: {},
  data() {
    return {
      // 时间戳存
      activities: [],
      evaluate: {},
      visible: false,
      visible2: false,
      visible3: false,
      visible4: false,
      visible5: false,
      visible6: false,
      visible7: false,
      visible8: false,
      iscancel: true,
      sendDisabled: '',
      ifExistGL: '',
      ifExistCQ: '',
      ifExistMFL: '',
      ifExistJJ: '',
      ifExistXF: '',
      ifExistSP: '',
      ifExistLX: '',
      ifExistZL: '',
      GL: {
        water: '',
        solid: '',
        air: '',
        extract: '',
        R_water: '',
        R_solid: '',
        R_air: ''
      },
      CQ: {
        water: '',
        solid: '',
        air: '',
        extract: '',
        R_water: '',
        R_solid: '',
        R_air: ''
      },
      MFL: {
        water: '',
        solid: '',
        air: '',
        extract: '',
        R_water: '',
        R_solid: '',
        R_air: ''
      },
      JJ: {
        water: '',
        solid: '',
        air: '',
        extract: '',
        R_water: '',
        R_solid: '',
        R_air: ''
      },
      XF: {
        water: '',
        solid: '',
        air: '',
        extract: '',
        R_water: '',
        R_solid: '',
        R_air: ''
      },
      SP: {
        water: '',
        solid: '',
        air: '',
        extract: '',
        R_water: '',
        R_solid: '',
        R_air: ''
      },
      LX: {
        water: '',
        solid: '',
        air: '',
        extract: '',
        R_water: '',
        R_solid: '',
        R_air: ''
      },
      ZL: {
        water: '',
        solid: '',
        air: '',
        extract: '',
        R_water: '',
        R_solid: '',
        R_air: ''
      },
      processArray: [],
      isDisabled: false,
      tooltipDis: true
    }
  },
  computed: {

    exitsValGL: function() {
      this.ifExistGL = parseFloat(this.GL.water) + parseFloat(this.GL.solid) + parseFloat(this.GL.air) + parseFloat(this.GL.extract)
    },
    exitsValCQ: function() {
      this.ifExistCQ = parseFloat(this.CQ.water) + parseFloat(this.CQ.solid) + parseFloat(this.CQ.air) + parseFloat(this.CQ.extract)
    },
    exitsValMFL: function() {
      this.ifExistMFL = parseFloat(this.MFL.water) + parseFloat(this.MFL.solid) + parseFloat(this.MFL.air) + parseFloat(this.MFL.extract)
    },
    exitsValJJ: function() {
      this.ifExistJJ = parseFloat(this.JJ.water) + parseFloat(this.JJ.solid) + parseFloat(this.JJ.air) + parseFloat(this.JJ.extract)
    },
    exitsValXF: function() {
      this.ifExistXF = parseFloat(this.XF.water) + parseFloat(this.XF.solid) + parseFloat(this.XF.air) + parseFloat(this.XF.extract)
    },
    exitsValSP: function() {
      this.ifExistSP = parseFloat(this.SP.water) + parseFloat(this.SP.solid) + parseFloat(this.SP.air) + parseFloat(this.SP.extract)
    },
    exitsValLX: function() {
      this.ifExistLX = parseFloat(this.LX.water) + parseFloat(this.LX.solid) + parseFloat(this.LX.air) + parseFloat(this.LX.extract)
    },
    exitsValZL: function() {
      this.ifExistZL = parseFloat(this.ZL.water) + parseFloat(this.ZL.solid) + parseFloat(this.ZL.air) + parseFloat(this.ZL.extract)
    }
    // exitsTag:function (){
    //   this.ifExistTag=this.processArray.length;
    // }
  },
  watch: { // 使用这个 属性，可以监视 data 中指定数据的变化，然后触发这个 watch 中对应的 function 处理函数
    ifExistGL(newVal, oldVal) {
      if (isNaN(newVal) || newVal === 1) {
        // 三个input框内都有值时需要做的操作
        console.log('确定按钮可用',newVal)
        this.isDisabled = false
      } else {
        // 至少一个没有值
        console.log('确定按钮不可用')
        this.isDisabled = true
      }
    },
    ifExistCQ(newVal, oldVal) {
      if (isNaN(newVal) || newVal === 1) {
        // 三个input框内都有值时需要做的操作
        console.log('确定按钮可用')
        this.isDisabled = false
      } else {
        // 至少一个没有值
        console.log('确定按钮不可用')
        this.isDisabled = true
      }
    },
    ifExistMFL(newVal, oldVal) {
      if (isNaN(newVal) || newVal === 1) {
        // 三个input框内都有值时需要做的操作
        console.log('确定按钮可用')
        this.isDisabled = false
      } else {
        // 至少一个没有值
        console.log('确定按钮不可用')
        this.isDisabled = true
      }
    },
    ifExistJJ(newVal, oldVal) {
      if (isNaN(newVal) || newVal === 1) {
        // 三个input框内都有值时需要做的操作
        console.log('确定按钮可用')
        this.isDisabled = false
      } else {
        // 至少一个没有值
        console.log('确定按钮不可用')
        this.isDisabled = true
      }
    },
    ifExistXF(newVal, oldVal) {
      if (isNaN(newVal) || newVal === 1) {
        // 三个input框内都有值时需要做的操作
        console.log('确定按钮可用')
        this.isDisabled = false
      } else {
        // 至少一个没有值
        console.log('确定按钮不可用')
        this.isDisabled = true
      }
    },
    ifExistSP(newVal, oldVal) {
      if (isNaN(newVal) || newVal === 1) {
        // 三个input框内都有值时需要做的操作
        console.log('确定按钮可用')
        this.isDisabled = false
      } else {
        // 至少一个没有值
        console.log('确定按钮不可用')
        this.isDisabled = true
      }
    },
    ifExistLX(newVal, oldVal) {
      if (isNaN(newVal) || newVal === 1) {
        // 三个input框内都有值时需要做的操作
        console.log('确定按钮可用')
        this.isDisabled = false
      } else {
        // 至少一个没有值
        console.log('确定按钮不可用')
        this.isDisabled = true
      }
    },
    ifExistZL(newVal, oldVal) {
      if (isNaN(newVal) || newVal === 1) {
        // 三个input框内都有值时需要做的操作
        console.log('确定按钮可用')
        this.isDisabled = false
      } else {
        // 至少一个没有值
        console.log('确定按钮不可用')
        this.isDisabled = true
      }
    },
    ifExistTag(newVal, oldVal) {
      if (isNaN(newVal) || newVal === 1) {
        // 三个input框内都有值时需要做的操作
        console.log('确定按钮可用')
        this.iscancel = false
      } else {
        // 至少一个没有值
        console.log('确定按钮不可用')
        this.iscancel = true
      }
    },
    'MFL.water': function(newVal, oldValue) {
      console.log(newVal)
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.MFL.water = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'MFL.solid': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.MFL.solid = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'MFL.air': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.MFL.air = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'JJ.water': function(newVal, oldValue) {
      console.log(newVal)
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.JJ.water = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'JJ.solid': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.JJ.solid = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'JJ.air': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.JJ.air = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'XF.water': function(newVal, oldValue) {
      console.log(newVal)
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.XF.water = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'XF.solid': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.XF.solid = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'XF.air': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.XF.air = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'SP.water': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.SP.water = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'SP.solid': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.SP.solid = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'SP.air': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.SP.air = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'LX.water': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.LX.water = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'LX.solid': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.LX.solid = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'LX.air': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.LX.air = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'ZL.water': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.ZL.water = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'ZL.solid': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.ZL.solid = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'ZL.air': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.ZL.air = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'GL.water': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.GL.water = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'GL.solid': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.GL.solid = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'GL.air': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.GL.air = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'CQ.water': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.CQ.water = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'CQ.solid': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.CQ.solid = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    'CQ.air': function(newVal, oldValue) {
      if (parseFloat(newVal) < 0 || parseFloat(newVal) > 1) {
        this.CQ.air = ''
        this.$message({
          message: '数值只能在0-1之间',
          type: 'warning'
        })
      }
    },
    processArray: function() {
      if (this.processArray.length >= 1) {
        this.iscancel = false
      } else {
        this.iscancel = true
      }
    }
  },
  methods: {
    deleteone() {
      this.activities.pop()
      this.processArray.pop()
      console.log(this.processArray)
    },
    goBack() {
      this.$emit('goBack')
    },
    addtag(tag, time) {
      this.activities.push({
        content: tag,
        timestamp: time,
        size: 'large',
        type: 'primary',
        icon: 'el-icon-more'
      })
    },
    savepross(name) {
      // eslint-disable-next-line no-empty
      switch (name) {
        case 'GL':
          this.GL.airfactor = '0'
          this.GL.waterfactor = '0.1'
          this.GL.solidfactor = '0.1'
          this.GL.moextract = '0.8'
          this.GL.flag = '过滤法'
          this.processArray.push(this.GL)
          this.GL = {
            water: '',
            solid: '',
            air: '',
            extract: '',
            R_water: '',
            R_solid: '',
            R_air: ''
          }
          break
        case 'CQ':
          this.CQ.airfactor = '0.01'
          this.CQ.waterfactor = '0.04'
          this.CQ.solidfactor = '0.05'
          this.CQ.moextract = '0.9'

          this.CQ.flag = '萃取法'
          this.processArray.push(this.CQ)
          this.CQ = {
            water: '',
            solid: '',
            air: '',
            extract: '',
            R_water: '',
            R_solid: '',
            R_air: ''
          }
          break
        case 'MFL':
          this.MFL.airfactor = '0'
          this.MFL.waterfactor = '0.01'
          this.MFL.solidfactor = '0.04'
          this.MFL.moextract = '0.95'
          this.MFL.flag = '膜分离法'
          this.processArray.push(this.MFL)
          this.MFL = {
            water: '',
            solid: '',
            air: '',
            extract: '',
            R_water: '',
            R_solid: '',
            R_air: ''
          }
          break
        case 'JJ':
          this.JJ.airfactor = '0.01'
          this.JJ.waterfactor = '0.04'
          this.JJ.solidfactor = '0.05'
          this.JJ.moextract = '0.9'
          this.JJ.flag = '结晶法'
          this.processArray.push(this.JJ)
          this.JJ = {
            water: '',
            solid: '',
            air: '',
            extract: '',
            R_water: '',
            R_solid: '',
            R_air: ''
          }
          break
        case 'XF':
          this.XF.airfactor = '0'
          this.XF.waterfactor = '0.07'
          this.XF.solidfactor = '0.08'
          this.XF.moextract = '0.85'
          this.XF.flag = '吸附法'
          this.processArray.push(this.XF)
          this.XF = {
            water: '',
            solid: '',
            air: '',
            extract: '',
            R_water: '',
            R_solid: '',
            R_air: ''
          }
          break
        case 'SP':
          this.SP.airfactor = '0'
          this.SP.waterfactor = '0.05'
          this.SP.solidfactor = '0.05'
          this.SP.moextract = '0.9'
          this.SP.flag = '色谱法'
          this.processArray.push(this.SP)
          this.SP = {
            water: '',
            solid: '',
            air: '',
            extract: '',
            R_water: '',
            R_solid: '',
            R_air: ''
          }
          break
        case 'LX':
          this.LX.airfactor = '0'
          this.LX.waterfactor = '0.07'
          this.LX.solidfactor = '0.08'
          this.LX.moextract = '0.85'
          this.LX.flag = '离心法'
          this.processArray.push(this.LX)
          this.LX = {
            water: '',
            solid: '',
            air: '',
            extract: '',
            R_water: '',
            R_solid: '',
            R_air: ''
          }
          break
        case 'ZL':
          this.ZL.airfactor = '0.02'
          this.ZL.waterfactor = '0.09'
          this.ZL.solidfactor = '0.09'
          this.ZL.moextract = '0.8'
          this.ZL.flag = '蒸馏法'
          this.processArray.push(this.ZL)
          this.ZL = {
            water: '',
            solid: '',
            air: '',
            extract: '',
            R_water: '',
            R_solid: '',
            R_air: ''
          }
          break
      }
      console.log('11111111111', this.processArray[0].waterfactor)
    },
    sendEmissionFactor() {
      const emissionFactor = {
        processArray: this.processArray
        /*    CQ: this.CQ,
        MFL: this.MFL,
        JJ: this.JJ,
        XF: this.XF,
        SP: this.SP,
        LX: this.LX,
        ZL: this.ZL,*/
      }
      this.$store.commit('setEmissionFactor', emissionFactor)
      this.$emit('listenChild')
    }

  }
}

</script>

<style scoped lang="scss">
.title {
  position: absolute;
  left: 0px;
}

.content {
  position: absolute;
  top: 50px;
  left: 20%;
  right: 25%;

}

#el-input {
  height: 50px;
}

.el-divider--vertical {
  display: inline-block;
  width: 1px;
  height: 50px; //更改竖向分割线长度
  margin: 0 8px;
  vertical-align: middle;
  position: relative;
}

.right {
  position: relative;
  float: right;
  top: 50px;
  right: 6%;
}

.el-timeline-item {
  transition: all .5s;
}

.el-timeline-item:hover {
  margin-top: -5px;
}

.el-card:hover {
}

</style>
